<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function fn(a) {
            var str=a+""
            document.write(a+"这个数字的长度是"+str.length)
        }
        var a = prompt("求1~n个偶数和,请输入n")
        fn(a);
    </script>
</head>

<body>

</body>

</html>